package demo1;

import java.util.Scanner;

/**
 * Created with IntelliJ IDEA.
 * Description:
 * Author:  LiuTao
 * Version: 1.0
 * Date:    2023-10-19  08:37
 */
public class Test {
    public static void main(String[] args) {
        Scanner sca = new Scanner(System.in);
        int[][] arr = new int[10][10];
        for(int i = 0; i < arr.length; i++) {
            for(int j = 0; j < arr[i].length; j++) {
                arr[i][j] = sca.nextInt();
            }
        }
        int count = 0;
        int sum = 1;
        for(int i = 0; i < count + 1; i++) {
            for(int j = count; j <= count; j++) {
                if(arr[i][j] == 0) {
                    System.out.println(sum-1);
                    return;
                }
                sum *= arr[i][j];
            }
            count++;
            if(count == 10) {
                System.out.println(sum);
                return;
            }
        }
    }
}
// 1 2 3 4 5 6 7 8 9 10     1
// 1 2 3 4 5 6 7 8 9 10     2
// 1 2 3 4 5 6 7 8 9 10     3
// 1 2 3 4 5 6 7 8 9 10     4
// 1 2 3 4 5 6 7 8 9 10     5
// 1 2 3 4 5 6 7 8 9 10     6
// 1 2 3 4 5 6 7 8 9 10     7
// 1 2 3 4 5 6 7 8 9 10     8
// 1 2 3 4 5 6 7 8 9 10     9
// 1 2 3 4 5 6 7 8 9 10     10

